package asc.biz.daoImpl;

import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.orm.ibatis.SqlMapClientTemplate;
import org.springframework.stereotype.Repository;

import asc.biz.dao.AscCounselDao;
import asc.biz.vo.AscCounsel;

@Repository("AscCounselDao")
public class AscCounselDaoImpl implements AscCounselDao{
	protected Log log = LogFactory.getLog(this.getClass());
	
	@Autowired
	private SqlMapClientTemplate sqlMapClientTemplate;
	   
	public List<AscCounsel> getCounselList(AscCounsel dto) {
		return sqlMapClientTemplate.queryForList("getCounselList",dto);
	}

	public int insertCounsel(AscCounsel dto) {
		sqlMapClientTemplate.insert("insertCounsel", dto);
		return 0;
	}

	public int updateCounsel(AscCounsel dto) {
		return sqlMapClientTemplate.update("updateCounsel", dto);
	}

	public int deleteCounsel(AscCounsel dto) {
		return sqlMapClientTemplate.delete("deleteCounsel", dto);
	}

	@Override
	public int getCounselCount(AscCounsel dto) {
		return Integer.parseInt(""+sqlMapClientTemplate.queryForObject("getCounselCount",dto));
	}
}
